home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / complib / dtgevc.z / dtgevc
Text File  |  1998-10-30  |  10KB  |  265 lines

  1.  
  2.  
  3.  
  4. DDDDTTTTGGGGEEEEVVVVCCCC((((3333FFFF))))                                                          DDDDTTTTGGGGEEEEVVVVCCCC((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      DTGEVC - compute some or all of the right and/or left generalized
  10.      eigenvectors of a pair of real upper triangular matrices (A,B)
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      SUBROUTINE DTGEVC( SIDE, HOWMNY, SELECT, N, A, LDA, B, LDB, VL, LDVL, VR,
  14.                         LDVR, MM, M, WORK, INFO )
  15.  
  16.          CHARACTER      HOWMNY, SIDE
  17.  
  18.          INTEGER        INFO, LDA, LDB, LDVL, LDVR, M, MM, N
  19.  
  20.          LOGICAL        SELECT( * )
  21.  
  22.          DOUBLE         PRECISION A( LDA, * ), B( LDB, * ), VL( LDVL, * ), VR(
  23.                         LDVR, * ), WORK( * )
  24.  
  25. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  26.      DTGEVC computes some or all of the right and/or left generalized
  27.      eigenvectors of a pair of real upper triangular matrices (A,B).
  28.  
  29.      The right generalized eigenvector x and the left generalized eigenvector
  30.      y of (A,B) corresponding to a generalized eigenvalue w are defined by:
  31.  
  32.              (A - wB) * x = 0  and  y**H * (A - wB) = 0
  33.  
  34.      where y**H denotes the conjugate tranpose of y.
  35.  
  36.      If an eigenvalue w is determined by zero diagonal elements of both A and
  37.      B, a unit vector is returned as the corresponding eigenvector.
  38.  
  39.      If all eigenvectors are requested, the routine may either return the
  40.      matrices X and/or Y of right or left eigenvectors of (A,B), or the
  41.      products Z*X and/or Q*Y, where Z and Q are input orthogonal matrices.  If
  42.      (A,B) was obtained from the generalized real-Schur factorization of an
  43.      original pair of matrices
  44.         (A0,B0) = (Q*A*Z**H,Q*B*Z**H),
  45.      then Z*X and Q*Y are the matrices of right or left eigenvectors of A.
  46.  
  47.      A must be block upper triangular, with 1-by-1 and 2-by-2 diagonal blocks.
  48.      Corresponding to each 2-by-2 diagonal block is a complex conjugate pair
  49.      of eigenvalues and eigenvectors; only one
  50.      eigenvector of the pair is computed, namely the one corresponding to the
  51.      eigenvalue with positive imaginary part.
  52.  
  53.  
  54. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  55.      SIDE    (input) CHARACTER*1
  56.              = 'R': compute right eigenvectors only;
  57.              = 'L': compute left eigenvectors only;
  58.              = 'B': compute both right and left eigenvectors.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. DDDDTTTTGGGGEEEEVVVVCCCC((((3333FFFF))))                                                          DDDDTTTTGGGGEEEEVVVVCCCC((((3333FFFF))))
  71.  
  72.  
  73.  
  74.      HOWMNY  (input) CHARACTER*1
  75.              = 'A': compute all right and/or left eigenvectors;
  76.              = 'B': compute all right and/or left eigenvectors, and
  77.              backtransform them using the input matrices supplied in VR and/or
  78.              VL; = 'S': compute selected right and/or left eigenvectors,
  79.              specified by the logical array SELECT.
  80.  
  81.      SELECT  (input) LOGICAL array, dimension (N)
  82.              If HOWMNY='S', SELECT specifies the eigenvectors to be computed.
  83.              If HOWMNY='A' or 'B', SELECT is not referenced.  To select the
  84.              real eigenvector corresponding to the real eigenvalue w(j),
  85.              SELECT(j) must be set to .TRUE.  To select the complex
  86.              eigenvector corresponding to a complex conjugate pair w(j) and
  87.              w(j+1), either SELECT(j) or SELECT(j+1) must be set to .TRUE..
  88.  
  89.      N       (input) INTEGER
  90.              The order of the matrices A and B.  N >= 0.
  91.  
  92.      A       (input) DOUBLE PRECISION array, dimension (LDA,N)
  93.              The upper quasi-triangular matrix A.
  94.  
  95.      LDA     (input) INTEGER
  96.              The leading dimension of array A.  LDA >= max(1, N).
  97.  
  98.      B       (input) DOUBLE PRECISION array, dimension (LDB,N)
  99.              The upper triangular matrix B.  If A has a 2-by-2 diagonal block,
  100.              then the corresponding 2-by-2 block of B must be diagonal with
  101.              positive elements.
  102.  
  103.      LDB     (input) INTEGER
  104.              The leading dimension of array B.  LDB >= max(1,N).
  105.  
  106.      VL      (input/output) DOUBLE PRECISION array, dimension (LDVL,MM)
  107.              On entry, if SIDE = 'L' or 'B' and HOWMNY = 'B', VL must contain
  108.              an N-by-N matrix Q (usually the orthogonal matrix Q of left Schur
  109.              vectors returned by DHGEQZ).  On exit, if SIDE = 'L' or 'B', VL
  110.              contains:  if HOWMNY = 'A', the matrix Y of left eigenvectors of
  111.              (A,B); if HOWMNY = 'B', the matrix Q*Y; if HOWMNY = 'S', the left
  112.              eigenvectors of (A,B) specified by SELECT, stored consecutively
  113.              in the columns of VL, in the same order as their eigenvalues.  If
  114.              SIDE = 'R', VL is not referenced.
  115.  
  116.              A complex eigenvector corresponding to a complex eigenvalue is
  117.              stored in two consecutive columns, the first holding the real
  118.              part, and the second the imaginary part.
  119.  
  120.      LDVL    (input) INTEGER
  121.              The leading dimension of array VL.  LDVL >= max(1,N) if SIDE =
  122.              'L' or 'B'; LDVL >= 1 otherwise.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. DDDDTTTTGGGGEEEEVVVVCCCC((((3333FFFF))))                                                          DDDDTTTTGGGGEEEEVVVVCCCC((((3333FFFF))))
  137.  
  138.  
  139.  
  140.      VR      (input/output) COMPLEX*16 array, dimension (LDVR,MM)
  141.              On entry, if SIDE = 'R' or 'B' and HOWMNY = 'B', VR must contain
  142.              an N-by-N matrix Q (usually the orthogonal matrix Z of right
  143.              Schur vectors returned by DHGEQZ).  On exit, if SIDE = 'R' or
  144.              'B', VR contains:  if HOWMNY = 'A', the matrix X of right
  145.              eigenvectors of (A,B); if HOWMNY = 'B', the matrix Z*X; if HOWMNY
  146.              = 'S', the right eigenvectors of (A,B) specified by SELECT,
  147.              stored consecutively in the columns of VR, in the same order as
  148.              their eigenvalues.  If SIDE = 'L', VR is not referenced.
  149.  
  150.              A complex eigenvector corresponding to a complex eigenvalue is
  151.              stored in two consecutive columns, the first holding the real
  152.              part and the second the imaginary part.
  153.  
  154.      LDVR    (input) INTEGER
  155.              The leading dimension of the array VR.  LDVR >= max(1,N) if SIDE
  156.              = 'R' or 'B'; LDVR >= 1 otherwise.
  157.  
  158.      MM      (input) INTEGER
  159.              The number of columns in the arrays VL and/or VR. MM >= M.
  160.  
  161.      M       (output) INTEGER
  162.              The number of columns in the arrays VL and/or VR actually used to
  163.              store the eigenvectors.  If HOWMNY = 'A' or 'B', M is set to N.
  164.              Each selected real eigenvector occupies one column and each
  165.              selected complex eigenvector occupies two columns.
  166.  
  167.      WORK    (workspace) DOUBLE PRECISION array, dimension (6*N)
  168.  
  169.      INFO    (output) INTEGER
  170.              = 0:  successful exit.
  171.              < 0:  if INFO = -i, the i-th argument had an illegal value.
  172.              > 0:  the 2-by-2 block (INFO:INFO+1) does not have a complex
  173.              eigenvalue.
  174.  
  175. FFFFUUUURRRRTTTTHHHHEEEERRRR DDDDEEEETTTTAAAAIIIILLLLSSSS
  176.      Allocation of workspace:
  177.      ---------- -- ---------
  178.  
  179.         WORK( j ) = 1-norm of j-th column of A, above the diagonal
  180.         WORK( N+j ) = 1-norm of j-th column of B, above the diagonal
  181.         WORK( 2*N+1:3*N ) = real part of eigenvector
  182.         WORK( 3*N+1:4*N ) = imaginary part of eigenvector
  183.         WORK( 4*N+1:5*N ) = real part of back-transformed eigenvector
  184.         WORK( 5*N+1:6*N ) = imaginary part of back-transformed eigenvector
  185.  
  186.      Rowwise vs. columnwise solution methods:
  187.      ------- --  ---------- -------- -------
  188.  
  189.      Finding a generalized eigenvector consists basically of solving the
  190.      singular triangular system
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. DDDDTTTTGGGGEEEEVVVVCCCC((((3333FFFF))))                                                          DDDDTTTTGGGGEEEEVVVVCCCC((((3333FFFF))))
  203.  
  204.  
  205.  
  206.       (A - w B) x = 0     (for right) or:   (A - w B)**H y = 0  (for left)
  207.  
  208.      Consider finding the i-th right eigenvector (assume all eigenvalues are
  209.      real). The equation to be solved is:
  210.           n                   i
  211.      0 = sum  C(j,k) v(k)  = sum  C(j,k) v(k)     for j = i,. . .,1
  212.          k=j                 k=j
  213.  
  214.      where  C = (A - w B)  (The components v(i+1:n) are 0.)
  215.  
  216.      The "rowwise" method is:
  217.  
  218.      (1)  v(i) := 1
  219.      for j = i-1,. . .,1:
  220.                              i
  221.          (2) compute  s = - sum C(j,k) v(k)   and
  222.                            k=j+1
  223.  
  224.          (3) v(j) := s / C(j,j)
  225.  
  226.      Step 2 is sometimes called the "dot product" step, since it is an inner
  227.      product between the j-th row and the portion of the eigenvector that has
  228.      been computed so far.
  229.  
  230.      The "columnwise" method consists basically in doing the sums for all the
  231.      rows in parallel.  As each v(j) is computed, the contribution of v(j)
  232.      times the j-th column of C is added to the partial sums.  Since FORTRAN
  233.      arrays are stored columnwise, this has the advantage that at each step,
  234.      the elements of C that are accessed are adjacent to one another, whereas
  235.      with the rowwise method, the elements accessed at a step are spaced LDA
  236.      (and LDB) words apart.
  237.  
  238.      When finding left eigenvectors, the matrix in question is the transpose
  239.      of the one in storage, so the rowwise method then actually accesses
  240.      columns of A and B at each step, and so is the preferred method.
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.